Optimal. Leaf size=46 \[ \frac {x}{a+b}-\frac {\sqrt {b} \text {ArcTan}\left (\frac {\sqrt {a} \tanh (c+d x)}{\sqrt {b}}\right )}{\sqrt {a} (a+b) d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.05, antiderivative size = 46, normalized size of antiderivative = 1.00, number of steps
used = 3, number of rules used = 3, integrand size = 14, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.214, Rules used = {3741, 3756,
211} \begin {gather*} \frac {x}{a+b}-\frac {\sqrt {b} \text {ArcTan}\left (\frac {\sqrt {a} \tanh (c+d x)}{\sqrt {b}}\right )}{\sqrt {a} d (a+b)} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 211
Rule 3741
Rule 3756
Rubi steps
\begin {align*} \int \frac {1}{a+b \coth ^2(c+d x)} \, dx &=\frac {x}{a+b}-\frac {b \int \frac {\text {csch}^2(c+d x)}{a+b \coth ^2(c+d x)} \, dx}{a+b}\\ &=\frac {x}{a+b}+\frac {b \text {Subst}\left (\int \frac {1}{a+b x^2} \, dx,x,\coth (c+d x)\right )}{(a+b) d}\\ &=\frac {x}{a+b}-\frac {\sqrt {b} \tan ^{-1}\left (\frac {\sqrt {a} \tanh (c+d x)}{\sqrt {b}}\right )}{\sqrt {a} (a+b) d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.04, size = 47, normalized size = 1.02 \begin {gather*} \frac {-\frac {\sqrt {b} \text {ArcTan}\left (\frac {\sqrt {a} \tanh (c+d x)}{\sqrt {b}}\right )}{\sqrt {a}}+\tanh ^{-1}(\tanh (c+d x))}{(a+b) d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.86, size = 71, normalized size = 1.54
method | result | size |
derivativedivides | \(\frac {\frac {\ln \left (\coth \left (d x +c \right )+1\right )}{2 b +2 a}+\frac {b \arctan \left (\frac {b \coth \left (d x +c \right )}{\sqrt {a b}}\right )}{\left (a +b \right ) \sqrt {a b}}-\frac {\ln \left (\coth \left (d x +c \right )-1\right )}{2 b +2 a}}{d}\) | \(71\) |
default | \(\frac {\frac {\ln \left (\coth \left (d x +c \right )+1\right )}{2 b +2 a}+\frac {b \arctan \left (\frac {b \coth \left (d x +c \right )}{\sqrt {a b}}\right )}{\left (a +b \right ) \sqrt {a b}}-\frac {\ln \left (\coth \left (d x +c \right )-1\right )}{2 b +2 a}}{d}\) | \(71\) |
risch | \(\frac {x}{a +b}+\frac {\sqrt {-a b}\, \ln \left ({\mathrm e}^{2 d x +2 c}-\frac {a +2 \sqrt {-a b}-b}{a +b}\right )}{2 a \left (a +b \right ) d}-\frac {\sqrt {-a b}\, \ln \left ({\mathrm e}^{2 d x +2 c}+\frac {2 \sqrt {-a b}-a +b}{a +b}\right )}{2 a \left (a +b \right ) d}\) | \(108\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.48, size = 56, normalized size = 1.22 \begin {gather*} \frac {b \arctan \left (\frac {{\left (a + b\right )} e^{\left (-2 \, d x - 2 \, c\right )} - a + b}{2 \, \sqrt {a b}}\right )}{\sqrt {a b} {\left (a + b\right )} d} + \frac {d x + c}{{\left (a + b\right )} d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 81 vs.
\(2 (38) = 76\).
time = 0.41, size = 488, normalized size = 10.61 \begin {gather*} \left [\frac {2 \, d x + \sqrt {-\frac {b}{a}} \log \left (\frac {{\left (a^{2} + 2 \, a b + b^{2}\right )} \cosh \left (d x + c\right )^{4} + 4 \, {\left (a^{2} + 2 \, a b + b^{2}\right )} \cosh \left (d x + c\right ) \sinh \left (d x + c\right )^{3} + {\left (a^{2} + 2 \, a b + b^{2}\right )} \sinh \left (d x + c\right )^{4} - 2 \, {\left (a^{2} - b^{2}\right )} \cosh \left (d x + c\right )^{2} + 2 \, {\left (3 \, {\left (a^{2} + 2 \, a b + b^{2}\right )} \cosh \left (d x + c\right )^{2} - a^{2} + b^{2}\right )} \sinh \left (d x + c\right )^{2} + a^{2} - 6 \, a b + b^{2} + 4 \, {\left ({\left (a^{2} + 2 \, a b + b^{2}\right )} \cosh \left (d x + c\right )^{3} - {\left (a^{2} - b^{2}\right )} \cosh \left (d x + c\right )\right )} \sinh \left (d x + c\right ) - 4 \, {\left ({\left (a^{2} + a b\right )} \cosh \left (d x + c\right )^{2} + 2 \, {\left (a^{2} + a b\right )} \cosh \left (d x + c\right ) \sinh \left (d x + c\right ) + {\left (a^{2} + a b\right )} \sinh \left (d x + c\right )^{2} - a^{2} + a b\right )} \sqrt {-\frac {b}{a}}}{{\left (a + b\right )} \cosh \left (d x + c\right )^{4} + 4 \, {\left (a + b\right )} \cosh \left (d x + c\right ) \sinh \left (d x + c\right )^{3} + {\left (a + b\right )} \sinh \left (d x + c\right )^{4} - 2 \, {\left (a - b\right )} \cosh \left (d x + c\right )^{2} + 2 \, {\left (3 \, {\left (a + b\right )} \cosh \left (d x + c\right )^{2} - a + b\right )} \sinh \left (d x + c\right )^{2} + 4 \, {\left ({\left (a + b\right )} \cosh \left (d x + c\right )^{3} - {\left (a - b\right )} \cosh \left (d x + c\right )\right )} \sinh \left (d x + c\right ) + a + b}\right )}{2 \, {\left (a + b\right )} d}, \frac {d x - \sqrt {\frac {b}{a}} \arctan \left (\frac {{\left ({\left (a + b\right )} \cosh \left (d x + c\right )^{2} + 2 \, {\left (a + b\right )} \cosh \left (d x + c\right ) \sinh \left (d x + c\right ) + {\left (a + b\right )} \sinh \left (d x + c\right )^{2} - a + b\right )} \sqrt {\frac {b}{a}}}{2 \, b}\right )}{{\left (a + b\right )} d}\right ] \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 253 vs.
\(2 (37) = 74\).
time = 3.90, size = 253, normalized size = 5.50 \begin {gather*} \begin {cases} \frac {\tilde {\infty } x}{\coth ^{2}{\left (c \right )}} & \text {for}\: a = 0 \wedge b = 0 \wedge d = 0 \\\frac {x - \frac {\tanh {\left (c + d x \right )}}{d}}{b} & \text {for}\: a = 0 \\- \frac {d x \tanh ^{2}{\left (c + d x \right )}}{2 b d \tanh ^{2}{\left (c + d x \right )} - 2 b d} + \frac {d x}{2 b d \tanh ^{2}{\left (c + d x \right )} - 2 b d} - \frac {\tanh {\left (c + d x \right )}}{2 b d \tanh ^{2}{\left (c + d x \right )} - 2 b d} & \text {for}\: a = - b \\\frac {x}{a} & \text {for}\: b = 0 \\\frac {x}{a + b \coth ^{2}{\left (c \right )}} & \text {for}\: d = 0 \\\frac {2 a d x \sqrt {- \frac {b}{a}}}{2 a^{2} d \sqrt {- \frac {b}{a}} + 2 a b d \sqrt {- \frac {b}{a}}} - \frac {b \log {\left (- \sqrt {- \frac {b}{a}} + \tanh {\left (c + d x \right )} \right )}}{2 a^{2} d \sqrt {- \frac {b}{a}} + 2 a b d \sqrt {- \frac {b}{a}}} + \frac {b \log {\left (\sqrt {- \frac {b}{a}} + \tanh {\left (c + d x \right )} \right )}}{2 a^{2} d \sqrt {- \frac {b}{a}} + 2 a b d \sqrt {- \frac {b}{a}}} & \text {otherwise} \end {cases} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.40, size = 65, normalized size = 1.41 \begin {gather*} -\frac {\frac {b \arctan \left (\frac {a e^{\left (2 \, d x + 2 \, c\right )} + b e^{\left (2 \, d x + 2 \, c\right )} - a + b}{2 \, \sqrt {a b}}\right )}{\sqrt {a b} {\left (a + b\right )}} - \frac {d x + c}{a + b}}{d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.11, size = 37, normalized size = 0.80 \begin {gather*} \frac {x}{a+b}+\frac {b\,\mathrm {atan}\left (\frac {b\,\mathrm {coth}\left (c+d\,x\right )}{\sqrt {a\,b}}\right )}{d\,\sqrt {a\,b}\,\left (a+b\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________